﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;
using Application;

namespace UserControls
{
    public partial class AddNews : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void save_Click(object sender, EventArgs e)
        {
            VONews news = new VONews();
            news.Title = txtTitle.Text;
            news.Created = DateTime.Now.ToString();
            news.Modified = DateTime.Now.ToString();
            news.Description = txtDesc.Text;
            BusinessNews.AddNews(news);
            string url = "/PageLayout/NewsPageLayout.aspx";
            this.Page.ClientScript.RegisterStartupScript(this.GetType(), "OpenWin", "<script>openNewWin('" + url + "')</script>"); 
        }
    }
}